import 'package:flutter/material.dart';
import 'package:flutter_cli/theme/theme.dart';
import 'package:get/get.dart';

class GlobalController extends GetxController {

  /// 背景色
  Color backgroundColor(){
    if (theme.value == ThemeStyle.light.value){
      return Colors.white;
    }else {
      return Colors.black;
    }
    update(['home']);
  }

  /// 当前主题
  RxString theme = ThemeStyle.light.value.obs;

  appColorChange(val) {
    theme.value = val;
    print(theme.value);
  }
}

final GlobalController global = Get.put(GlobalController());
